package com.fastadmin.skill;

import java.util.Scanner;

public class _字符逆序 {
	public static void main(String... strings) {
//		a();
		String s = "123456";
		String reverse = reverse(s);
		System.out.println(reverse);
		System.out.println(s.substring(1));

	}

	private static String reverse(String s) {
		if (s.length() == 1 || s == null) {
			return s;
		}
		return reverse(s.substring(1)) + s.charAt(0);
	}

	private static void a() {
		Scanner cin = new Scanner(System.in);
		String s=cin.nextLine();
		StringBuilder sb=new StringBuilder();
		for (int i = s.length()-1; i >=0; i--) {
			sb.append(s.charAt(i));
		}
		System.out.println(sb);
	}
}